<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
		p{
			color: black;
			text-align: center;
			font-family: "楷体";
			font-size: 50px;
		}
		div{
			/*background-color: #000000;*/
			width: 600px;
			height: 550px;
		}
		h2{
			color: black;
			text-align: center;
			
			font-size: 80px;
		}
		h3{
			color: black;
			font-size: 50px;
			padding-left: 120px;
		}
		</style>
	</head>
	<body>
		<div>
			<h2>超酷时钟</h2>
			<h3>2018年06月07日</h3>
			<p id="time"></p>
		</div>
		
		<script>
			function mytime(){
				var now=new Date();
				var week=now.getDay()
				var hour=now.getHours();
				var minute=now.getMinutes();
				var seconds=now.getSeconds();
				minute=(minute<10?'0'+minute:minute);
				seconds=(seconds<10?'0'+seconds:seconds);
				var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
				//显示在html元素对象
				var time=document.getElementById('time');
				time.innerHTML=hour+":"+minute+":"+seconds+"\t"+weekday[week];
			}
			window.setInterval(mytime,1000);
			
		</script>
	</body>
</html>
